/*! \file
 * \brief Enter a brief description here.
 *
 * Enter a detailed description here. (optional)
 * \author Author (Ivo Wingelaar)
 * \date Date (2011)
 * \version Version (0.0.1)
 * \copyright Copyright (GNU LGPL v3)
 */

#ifndef __LYNX_PARALLAX_MAP_RENDERER_HPP_INCLUDED__
#define __LYNX_PARALLAX_MAP_RENDERER_HPP_INCLUDED__

#include "LynxShaderMaterialRenderer.hpp"

namespace Lynx
{

//! Class for rendering normal maps with OpenGL
class ParallaxMapRenderer : public ShaderMaterialRenderer, public ShaderConstantSetCallBack
{
public:
    //! Constructor
    ParallaxMapRenderer(VideoManager_C* driver,
                        int32_t& outMaterialTypeNr, MaterialRenderer* baseMaterial);
    //! Destructor
    ~ParallaxMapRenderer();

    //! Called by the engine when the vertex and/or pixel shader constants for an
    //! material renderer should be set.
    virtual void on_set_constants(MaterialRendererServices* services, int32_t userData);

    //! Returns the render capability of the material.
    virtual int32_t get_render_capability() const;

    virtual void on_set_material(const Material& material) { }
    virtual void on_set_material(const Material& material,
                               const Material& lastMaterial,
                               bool resetAllRenderstates, MaterialRendererServices* services);

protected:
    bool mCompiledShaders;
    float mCurrentScale;
};

} // namespace Lynx

#endif // __LYNX_PARALLAX_MAP_RENDERER_HPP_INCLUDED__

